package com.example.administrator.myapplication.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.ViewGroup;

/**
 * fragment 基类
 * Created by Administrator on 2017/4/12.
 */

public abstract class BaseFragment extends Fragment {
    public Activity mActivity;

    public void onCreate(Bundle savedInstanceState) {//保存的实现的状态
        mActivity = getActivity();
    }

    //处理fragmenty的布局
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return initViews();

    }

    //依附的activity的创建完成
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    //子类 初始化布局的方法
    public abstract View initViews();

    //初始化数据
    public void initData() {

    }
}
